<?php
namespace Secret\Services;

class UserSP implements \Silex\ServiceProviderInterface {

	protected $app;

	public function register(\Silex\Application $app, array $options = array()) {
		$app['user'] = $this;
		$this->app = $app;
	}

	public function boot(\Silex\Application $app) {}
	
	public function getUser() {
		if ($this->app['security']->getToken()) {
			return $this->app['security']->getToken()->getUser();
		}
		return false;
	}
}